<?php
using("model/ModList");
$modid=intval($urlparams['_p0']);
$page=intval(I('page'));
XModel::Set('iftag',1);
XModel::Set('subname',"版本历史");
$data=M('modlist')->where(['id'=>$modid])->find();
if($data==false)XModel::error("参数错误");
if($data['uid']==S('uid'))$userinfo=$user;
else $userinfo=M('user')->where(['id'=>$data['uid']])->find();
XModel::Set('flagshtml',ModList::getModsFlags($data['modflags'],14,14,"#ffffff"));
XModel::Set('nickname',$userinfo['nickname']);
XModel::Set('usericon',XModel::getHeadimg($userinfo['headimg'],$userinfo['nickname']));
XModel::Set('modname',$data['fullname']);
XModel::Set('id',$modid);
XModel::Set('moddesc',$data['description']);
//获得release列表
$itemlist=M("modrelease")->where(['modid'=>$modid])->order('addTime','desc')->limit($page*5,5)->select();
$list="";
foreach($itemlist as $k=>$v){
    $moddowns=M('moddown')->where(['descid'=>$v['id']])->select();
    $v['md']=md5($outconfig['modname'].$v['version']);
    $v['version']=$v['version'];
    $v['versionmd']=substr($v['md'],0,6);
    $v['time']=TimeFormat($v['addTime']);
    $v['lilist']=ModList::formatLiList($moddowns);
    $list.=XModel::LoadFrom("tagitem","mods",true,$v);
}
XModel::Set('itemlist',$list);
XModel::Set('verhtml',ModList::getAppVerHtml($data['supportVersion']));
XModel::Load("taglist","mods",false);